package com.xysq.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.rockcent.model.SearchBO;
import com.xysq.lemon.R;

import butterknife.InjectView;

/**
 * Created by huangdongkai on 2015/8/9.
 */
public class SearchAdapter extends BaseDataAdapter<SearchBO> {

    public SearchAdapter(Context context) {
        super(context);
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if (convertView == null) {
            convertView = inflater.inflate(R.layout.item_search_history, parent, false);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        SearchBO searchBO = itemList.get(position);
        holder.nameTxt.setText(searchBO.getName());
        return convertView;
    }

    static class ViewHolder extends BaseViewHolder {
        @InjectView(R.id.txt_customer_name)
        TextView nameTxt;

        public ViewHolder(View view) {
            super(view);
        }
    }
}
